import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Kind from '../views/Kind.vue'
import CateBrand from '../components/Kind/CateBrand.vue'
import Cart from '../views/Cart.vue'
import Confimgoods from '../views/Confimgoods.vue'
import My from '../views/My.vue'
import Bug from '../views/Bug.vue'
import Set from '../views/Set.vue'
import AddressList from '../views/AddressList.vue'
import AddressEdit from '../views/AddressEdit.vue'
import Error from '../views/Error.vue'
import Login from '../views/Login.vue'
import Register from '../views/register/Register.vue'
import Reg1 from '../views/register/Reg1.vue'
import Reg2 from '../views/register/Reg2.vue'
import Reg3 from '../views/register/Reg3.vue'
import Detail from '../views/Detail.vue'
import Search from '../views/Search.vue'
import Navs from '../views/Navs.vue'
import Footer from '../components/Footer/Footer.vue'

Vue.use(VueRouter)

const routes = [
  {
    path:"/",
    redirect: '/home',
  },
  {
    path: '/home',
    name: 'Home',
    components: {
      default:Home,
      Footer
    }
  },
  {
    path: '/search',
    name: 'Search',
    component:Search
  },
  {
    path: '/navs/:keyword',
    name: 'Navs',
    component:Navs
  },
  {
    path: '/kind',
    name: 'Kind',
    components:{
       default:Kind,
       Footer
    }
  },
  {
    path: '/Result/:phone/:brand',
    name: 'CateBrand',
    components:{
       default:CateBrand,
    }
  },
  {
    path: '/cart',
    name: 'Cart',
    components:{
      default:Cart,
      Footer
    }
  },
  {
    path:"/confimgods/:time",
    component:Confimgoods,
    components:{
      default:Confimgoods,
    }
},
  {
    path: '/my',
    name: 'My',
    components:{
      default:My,
      Footer
    }
  },
  {
    path: '/bug',
    name: 'Bug',
    components:{
      default:Bug,
    }
  },
  {
    path: '/set',
    name: 'Set',
    components:{
      default:Set,
    }
  },
  {
    path: '/addressList',
    name: 'AddressList',
    components:{
      default:AddressList,
    }
  },
  {
    path: '/addressedit',
    name: 'AddressEdit',
    components:{
      default:AddressEdit,
    }
  },
  {
    path: '/login',
    name: "Login",
    component: Login
  },
  {
    path: '/register',
    name: "Register",
    component: Register,
    redirect: 'register/one',
    children: [
      {
        path: "/register/one",
        name:"Reg1",
        component:Reg1
      },
      {
        path: "/register/two",
        name:"Reg2",
        component:Reg2
      },
      {
        path: "/register/three",
        name:"Reg3",
        component:Reg3
      }
    ]
  },
  {
    path: '/detail/:proid',
    name: 'Detail',
    component:Detail
  },
  {
    path: '*',
    name: 'Error',
    component: Error
  },
]

const router = new VueRouter({
  routes
})

export default router
